package org.backend.canteenbackend.service;

import org.backend.canteenbackend.entity.LineItem;
import org.backend.canteenbackend.entity.Order;
import org.backend.canteenbackend.entity.OrderStatus;
import org.backend.canteenbackend.vo.LineItemVO;
import org.backend.canteenbackend.vo.OrderVO;

import java.util.List;

public interface OrderService {
//订单状态有：未支付、未发货、已发货、已收货、已取消五种

    //删
    public boolean deleteOrderByOrderid(int orderid);

    public void deleteOrderStatusByOrderId(int orderId);
    public void deleteLineItemByOrderId(int orderId);

    //查
    public List<Order> findAllOrders();
    public Order findOrderByOrderid(int orderid);
    public List<Order> findOrderByUserid(String userid);

    public List<OrderStatus> findAllOrderStatus();
    public List<LineItem> findLineItemsByOrderId(int orderId);
    public List<OrderVO> findOrderVOs();
    public List<LineItemVO> findLineItemVOsByOrderId(int orderId);
    public OrderVO findOrderVOByOrderId(int orderId);
    public List<OrderVO> findOrderVOsByUserId(String userId);
    // public List<OrderVO> searchOrders(String keyword); hf，想实现模糊搜索

    //改
    public void updateOrderByOrderid(Order order);//可以修改订单中地址等全部内容
    public void updateStatusByOrderid(int orderid,String orderStatus);//只修改发货状态的    直接用上面那个方法就行
    public void updateInventoryByLineItem(List<LineItem> lineItemList);//更新库存
    public boolean checkStockByOrderId(int orderId);//检查库存是否充足
    public OrderVO enrichOrderWithListPrice(OrderVO orderVO);
    public  void updateAddressByOrderid(
            int orderId,
            String shipAddress1,
            String shipAddress2,
            String shipCity,
            String shipState,
            String shipZip
    );
}